const MusicHttp=require("../../utils/MusicHttp")
Page({

    data: {
        value: '',
        banner:"",
        hot:"",
        new:"",
        Dj:""
      },
      onChange(e) {
        this.setData({
          value: e.detail,
        });
      },
    
      onLoad: async function (options) {
        var hotRes = await MusicHttp.getHotSong();
        this.setData({hot:hotRes.data.playlists.slice(0,3)})

        var newRes =  await MusicHttp.getNewMusic();
        this.setData({new:newRes.data.albums.slice(0,3)})

        var djRes = await MusicHttp.getDj();
        this.setData({Dj:djRes.data.result.slice(0,3)})

        var banner= await MusicHttp.getBanner();
        this.setData({banner:banner.data.banners})
    },
    handleClick(event){
    console.log(event.currentTarget.dataset);
    wx:wx.navigateTo({
      url:`/pages/search/search`
    })
  }
})